| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

PbsMaterial.h
1 // PbsMaterial.h
3 //
5
6 namespace nkAstraeus
7 {
14 class PbsMaterial final : public Material
15 {
16 public :
17
23 PbsMaterial (System* system) noexcept ;
27 virtual ~PbsMaterial () ;
28
29 // Getters
33 nkMemory::StringView getPositionAttributeName () const ;
37 nkMemory::StringView getTexCoordAttributeName () const ;
41 nkMemory::StringView getNormalAttributeName () const ;
45 nkMemory::StringView getTangentAttributeName () const ;
49 nkMemory::StringView getBinormalAttributeName () const ;
53 nkMaths::Vector getLightDirection () const ;
57 nkMaths::Vector getLightColor () const ;
61 nkMaths::Vector getAlbedoColor () const ;
65 nkMaths::Vector getSpecularColor () const ;
69 nkMaths::Vector getEmissiveColor () const ;
73 nkMaths::Vector getEnvironmentColor () const ;
77 float getMetalness () const ;
81 float getRoughnessGlossiness () const ;
85 float getAlpha () const ;
89 float getAlphaCutoff () const ;
93 nkGraphics::Texture* getAlbedoTexture () const ;
97 nkGraphics::Texture* getSpecularTexture () const ;
101 nkGraphics::Texture* getEmissiveTexture () const ;
105 nkGraphics::Texture* getMetalnessTexture () const ;
109 nkGraphics::Texture* getRoughnessGlossinessTexture () const ;
113 nkGraphics::Texture* getAlphaTexture () const ;
117 nkGraphics::Texture* getOcclusionTexture () const ;
121 nkGraphics::Texture* getNormalMapTexture () const ;
125 nkGraphics::Texture* getEnvironmentTexture () const ;
129 nkGraphics::Texture* getIrradianceTexture () const ;
133 THREE_CHANNEL_PACK getAlbedoTextureChannels () const ;
137 THREE_CHANNEL_PACK getSpecularTextureChannels () const ;
141 THREE_CHANNEL_PACK getEmissiveTextureChannels () const ;
145 ONE_CHANNEL_PACK getMetalnessTextureChannels () const ;
149 ONE_CHANNEL_PACK getRoughnessGlossinessTextureChannels () const ;
153 ONE_CHANNEL_PACK getAlphaTextureChannels () const ;
157 ONE_CHANNEL_PACK getOcclusionTextureChannels () const ;
161 THREE_CHANNEL_PACK getNormalMapTextureChannels () const ;
165 THREE_CHANNEL_PACK getEnvironmentTextureChannels () const ;
169 THREE_CHANNEL_PACK getIrradianceTextureChannels () const ;
173 nkGraphics::Texture* getShadowMapTexture () const ;
177 nkGraphics::Camera* getShadowMapCamera () const ;
181 const ShadowMapParameters& getShadowMapParameters () const ;
185 PBS_MODEL getPbsModel () const ;
189 bool getEnvironmentTextureIsCubeByDefault () const ;
193 bool getIrradianceTextureIsCubeByDefault () const ;
197 bool getReconstructBinormals () const ;
201 bool getMixAlbedoColorAndTexture () const ;
205 bool getMixSpecularColorAndTexture () const ;
209 bool getMixEmissiveColorAndTexture () const ;
213 bool getMixMetalnessFactorAndTexture () const ;
217 bool getMixRoughnessGlossinessFactorAndTexture () const ;
221 bool getMixEnvironmentColorAndTexture () const ;
225 bool getMixAlphaFactorAndTexture () const ;
229 bool getCombineLightAndEnvironment () const ;
230
231 // Setters
239 void setPositionAttributeName (nkMemory::StringView value) ;
247 void setTexCoordAttributeName (nkMemory::StringView value) ;
255 void setNormalAttributeName (nkMemory::StringView value) ;
263 void setTangentAttributeName (nkMemory::StringView value) ;
271 void setBinormalAttributeName (nkMemory::StringView value) ;
280 void setLightDirection (const nkMaths::Vector& value) ;
288 void setLightColor (const nkMaths::Vector& value) ;
294 void setAlbedoColor (const nkMaths::Vector& value) ;
300 void setSpecularColor (const nkMaths::Vector& value) ;
306 void setEmissiveColor (const nkMaths::Vector& value) ;
314 void setEnvironmentColor (const nkMaths::Vector& value) ;
323 void setMetalness (float value) ;
333 void setRoughnessGlossiness (float value) ;
343 void setAlpha (float value) ;
353 void setAlphaCutoff (float value) ;
363 void setAlbedoTexture (nkGraphics::Texture* value, THREE_CHANNEL_PACK channels = THREE_CHANNEL_PACK::RGB) ;
373 void setSpecularTexture (nkGraphics::Texture* value, THREE_CHANNEL_PACK channels = THREE_CHANNEL_PACK::RGB) ;
383 void setEmissiveTexture (nkGraphics::Texture* value, THREE_CHANNEL_PACK channels = THREE_CHANNEL_PACK::RGB) ;
393 void setMetalnessTexture (nkGraphics::Texture* value, ONE_CHANNEL_PACK channel = ONE_CHANNEL_PACK::A) ;
403 void setRoughnessGlossinessTexture (nkGraphics::Texture* value, ONE_CHANNEL_PACK channel = ONE_CHANNEL_PACK::A) ;
414 void setAlphaTexture (nkGraphics::Texture* value, ONE_CHANNEL_PACK channel = ONE_CHANNEL_PACK::A) ;
426 void setOcclusionTexture (nkGraphics::Texture* value, ONE_CHANNEL_PACK channel = ONE_CHANNEL_PACK::A) ;
438 void setNormalMapTexture (nkGraphics::Texture* value, THREE_CHANNEL_PACK channels = THREE_CHANNEL_PACK::RGB) ;
459 void setEnvironmentTexture (nkGraphics::Texture* value, THREE_CHANNEL_PACK channels = THREE_CHANNEL_PACK::RGB, bool prefilteredEnv = false) ;
478 void setIrradianceTexture (nkGraphics::Texture* value, THREE_CHANNEL_PACK channels = THREE_CHANNEL_PACK::RGB) ;
489 void setShadowMapTexture (nkGraphics::Texture* value, nkGraphics::Camera* shadowCamera, const ShadowMapParameters& parameters = ShadowMapParameters()) ;
505 void setPbsModel (PBS_MODEL value) ;
514 void setEnvironmentTextureIsCubeByDefault (bool value) ;
523 void setIrradianceTextureIsCubeByDefault (bool value) ;
533 void setReconstructBinormals (bool value) ;
542 void setMixAlbedoColorAndTexture (bool value) ;
551 void setMixSpecularColorAndTexture (bool value) ;
560 void setMixEmissiveColorAndTexture (bool value) ;
569 void setMixMetalnessFactorAndTexture (bool value) ;
578 void setMixRoughnessGlossinessFactorAndTexture (bool value) ;
588 void setMixEnvironmentColorAndTexture (bool value) ;
597 void setMixAlphaFactorAndTexture (bool value) ;
608 void setCombineLightAndEnvironment (bool value) ;
609
610 // Load
611 virtual bool load () override ;
612 virtual void unload () override ;
613
614 // Import / export
615 virtual void exportClassToTree (nkExport::Node* rootNode) override ;
616 virtual void importClassFromTree (nkExport::Node* rootNode) override ;
617
618 public :
619
620 // Statics
631 static nkMemory::UniquePtr<PbsMaterial> create (System* system = nullptr) ;
632 } ;
633 }
nkAstraeus::PbsMaterial::getEnvironmentTextureChannels
THREE_CHANNEL_PACK getEnvironmentTextureChannels() const
nkAstraeus::PbsMaterial::getSpecularTextureChannels
THREE_CHANNEL_PACK getSpecularTextureChannels() const
nkAstraeus::PbsMaterial::getMixMetalnessFactorAndTexture
bool getMixMetalnessFactorAndTexture() const
nkAstraeus::PbsMaterial::getMetalnessTexture
nkGraphics::Texture * getMetalnessTexture() const
nkAstraeus::PbsMaterial::getEmissiveTexture
nkGraphics::Texture * getEmissiveTexture() const
nkAstraeus::PbsMaterial::setCombineLightAndEnvironment
void setCombineLightAndEnvironment(bool value)
nkAstraeus::PbsMaterial::setLightColor
void setLightColor(const nkMaths::Vector &value)
nkAstraeus::PbsMaterial::getNormalAttributeName
nkMemory::StringView getNormalAttributeName() const
nkAstraeus::PbsMaterial::getMixEmissiveColorAndTexture
bool getMixEmissiveColorAndTexture() const
nkAstraeus::PbsMaterial::getMetalnessTextureChannels
ONE_CHANNEL_PACK getMetalnessTextureChannels() const
nkAstraeus::PbsMaterial::setIrradianceTextureIsCubeByDefault
void setIrradianceTextureIsCubeByDefault(bool value)
nkGraphics::Camera
Offers all controls to model a camera.
Definition: Camera.h:14
nkAstraeus::PbsMaterial::setLightDirection
void setLightDirection(const nkMaths::Vector &value)
nkAstraeus::PbsMaterial::getEmissiveColor
nkMaths::Vector getEmissiveColor() const
nkAstraeus::PbsMaterial::getIrradianceTextureIsCubeByDefault
bool getIrradianceTextureIsCubeByDefault() const
nkAstraeus::PbsMaterial::getAlbedoTextureChannels
THREE_CHANNEL_PACK getAlbedoTextureChannels() const
nkAstraeus::PbsMaterial::~PbsMaterial
virtual ~PbsMaterial()
nkGraphics::Texture
A texture used for rendering, hosted on GPU.
Definition: Texture.h:35
nkAstraeus::PbsMaterial::getRoughnessGlossinessTexture
nkGraphics::Texture * getRoughnessGlossinessTexture() const
nkAstraeus::PbsMaterial::getAlphaCutoff
float getAlphaCutoff() const
nkAstraeus::PbsMaterial::getLightColor
nkMaths::Vector getLightColor() const
nkAstraeus::PbsMaterial::setMetalness
void setMetalness(float value)
nkAstraeus::PbsMaterial::setMixMetalnessFactorAndTexture
void setMixMetalnessFactorAndTexture(bool value)
nkAstraeus::PbsMaterial::getNormalMapTexture
nkGraphics::Texture * getNormalMapTexture() const
nkAstraeus::PbsMaterial::setEmissiveColor
void setEmissiveColor(const nkMaths::Vector &value)
nkAstraeus::PbsMaterial
A Physically Based Shading material.
Definition: PbsMaterial.h:15
nkAstraeus::THREE_CHANNEL_PACK
THREE_CHANNEL_PACK
Enumeration of texture channels, packed by three. The channel order is encoded in each value,...
Definition: ThreeChannelPack.h:13
nkAstraeus::PbsMaterial::getOcclusionTextureChannels
ONE_CHANNEL_PACK getOcclusionTextureChannels() const
nkAstraeus::PbsMaterial::setMixAlbedoColorAndTexture
void setMixAlbedoColorAndTexture(bool value)
nkAstraeus::PbsMaterial::getAlbedoColor
nkMaths::Vector getAlbedoColor() const
nkAstraeus::PbsMaterial::getNormalMapTextureChannels
THREE_CHANNEL_PACK getNormalMapTextureChannels() const
nkAstraeus::ShadowMapParameters
Exposes parameters for the shadow map setup in materials and effects supporting it.
Definition: ShadowMapParameters.h:12
nkAstraeus::PbsMaterial::getRoughnessGlossiness
float getRoughnessGlossiness() const
nkAstraeus::PbsMaterial::getAlbedoTexture
nkGraphics::Texture * getAlbedoTexture() const
nkAstraeus::System
The main entry point for nkAstraeus engine.
Definition: System.h:15
nkAstraeus::PbsMaterial::getShadowMapCamera
nkGraphics::Camera * getShadowMapCamera() const
nkAstraeus::PbsMaterial::getRoughnessGlossinessTextureChannels
ONE_CHANNEL_PACK getRoughnessGlossinessTextureChannels() const
nkAstraeus::PbsMaterial::PbsMaterial
PbsMaterial(System *system) noexcept
nkAstraeus::PbsMaterial::exportClassToTree
virtual void exportClassToTree(nkExport::Node *rootNode) override
nkAstraeus::PbsMaterial::setEnvironmentColor
void setEnvironmentColor(const nkMaths::Vector &value)
nkAstraeus::PbsMaterial::getLightDirection
nkMaths::Vector getLightDirection() const
nkAstraeus::PbsMaterial::getIrradianceTextureChannels
THREE_CHANNEL_PACK getIrradianceTextureChannels() const
nkAstraeus::PbsMaterial::setEmissiveTexture
void setEmissiveTexture(nkGraphics::Texture *value, THREE_CHANNEL_PACK channels=THREE_CHANNEL_PACK::RGB)
nkAstraeus::PbsMaterial::setOcclusionTexture
void setOcclusionTexture(nkGraphics::Texture *value, ONE_CHANNEL_PACK channel=ONE_CHANNEL_PACK::A)
nkAstraeus::PbsMaterial::getMixSpecularColorAndTexture
bool getMixSpecularColorAndTexture() const
nkAstraeus::PbsMaterial::getTexCoordAttributeName
nkMemory::StringView getTexCoordAttributeName() const
nkAstraeus::PbsMaterial::getEnvironmentTexture
nkGraphics::Texture * getEnvironmentTexture() const
nkAstraeus::PbsMaterial::setRoughnessGlossinessTexture
void setRoughnessGlossinessTexture(nkGraphics::Texture *value, ONE_CHANNEL_PACK channel=ONE_CHANNEL_PACK::A)
nkAstraeus::PbsMaterial::getBinormalAttributeName
nkMemory::StringView getBinormalAttributeName() const
nkAstraeus::PbsMaterial::setMixSpecularColorAndTexture
void setMixSpecularColorAndTexture(bool value)
nkAstraeus::PbsMaterial::setIrradianceTexture
void setIrradianceTexture(nkGraphics::Texture *value, THREE_CHANNEL_PACK channels=THREE_CHANNEL_PACK::RGB)
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkAstraeus::PbsMaterial::getAlphaTexture
nkGraphics::Texture * getAlphaTexture() const
nkAstraeus::PbsMaterial::setTexCoordAttributeName
void setTexCoordAttributeName(nkMemory::StringView value)
nkAstraeus::PbsMaterial::getMixEnvironmentColorAndTexture
bool getMixEnvironmentColorAndTexture() const
nkAstraeus::PbsMaterial::getPbsModel
PBS_MODEL getPbsModel() const
nkAstraeus::PbsMaterial::setAlpha
void setAlpha(float value)
nkAstraeus::PbsMaterial::setEnvironmentTextureIsCubeByDefault
void setEnvironmentTextureIsCubeByDefault(bool value)
nkAstraeus::ONE_CHANNEL_PACK::A
@ A
Alpha channel.
nkAstraeus::PbsMaterial::create
static nkMemory::UniquePtr< PbsMaterial > create(System *system=nullptr)
nkAstraeus::PbsMaterial::getMixAlbedoColorAndTexture
bool getMixAlbedoColorAndTexture() const
nkAstraeus::PBS_MODEL
PBS_MODEL
Lists the available PBS models available.
Definition: PbsModel.h:12
nkAstraeus::PbsMaterial::getMetalness
float getMetalness() const
nkAstraeus
Encompasses all API of component NilkinsAstraeus.
Definition: BlurComplexEffect.h:7
nkAstraeus::PbsMaterial::setAlphaCutoff
void setAlphaCutoff(float value)
nkAstraeus::PbsMaterial::getIrradianceTexture
nkGraphics::Texture * getIrradianceTexture() const
nkMemory::UniquePtr
Smart pointer owning the object instance it encapsulates.
Definition: UniquePtr.h:17
nkAstraeus::PbsMaterial::setBinormalAttributeName
void setBinormalAttributeName(nkMemory::StringView value)
nkAstraeus::PbsMaterial::getSpecularColor
nkMaths::Vector getSpecularColor() const
nkAstraeus::PbsMaterial::getAlpha
float getAlpha() const
nkAstraeus::PbsMaterial::setMixEnvironmentColorAndTexture
void setMixEnvironmentColorAndTexture(bool value)
nkAstraeus::PbsMaterial::getEmissiveTextureChannels
THREE_CHANNEL_PACK getEmissiveTextureChannels() const
nkAstraeus::PbsMaterial::getPositionAttributeName
nkMemory::StringView getPositionAttributeName() const
nkAstraeus::PbsMaterial::getMixRoughnessGlossinessFactorAndTexture
bool getMixRoughnessGlossinessFactorAndTexture() const
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkAstraeus::PbsMaterial::setAlbedoTexture
void setAlbedoTexture(nkGraphics::Texture *value, THREE_CHANNEL_PACK channels=THREE_CHANNEL_PACK::RGB)
nkAstraeus::PbsMaterial::setMixAlphaFactorAndTexture
void setMixAlphaFactorAndTexture(bool value)
nkAstraeus::PbsMaterial::setRoughnessGlossiness
void setRoughnessGlossiness(float value)
nkAstraeus::PbsMaterial::setAlbedoColor
void setAlbedoColor(const nkMaths::Vector &value)
nkAstraeus::PbsMaterial::importClassFromTree
virtual void importClassFromTree(nkExport::Node *rootNode) override
nkAstraeus::PbsMaterial::getShadowMapTexture
nkGraphics::Texture * getShadowMapTexture() const
nkAstraeus::PbsMaterial::getMixAlphaFactorAndTexture
bool getMixAlphaFactorAndTexture() const
nkAstraeus::PbsMaterial::setEnvironmentTexture
void setEnvironmentTexture(nkGraphics::Texture *value, THREE_CHANNEL_PACK channels=THREE_CHANNEL_PACK::RGB, bool prefilteredEnv=false)
nkAstraeus::PbsMaterial::getCombineLightAndEnvironment
bool getCombineLightAndEnvironment() const
nkAstraeus::PbsMaterial::getShadowMapParameters
const ShadowMapParameters & getShadowMapParameters() const
nkAstraeus::PbsMaterial::getSpecularTexture
nkGraphics::Texture * getSpecularTexture() const
nkAstraeus::ONE_CHANNEL_PACK
ONE_CHANNEL_PACK
Enumeration of texture channels, one by one.
Definition: OneChannelPack.h:12
nkAstraeus::PbsMaterial::getTangentAttributeName
nkMemory::StringView getTangentAttributeName() const
nkAstraeus::PbsMaterial::getOcclusionTexture
nkGraphics::Texture * getOcclusionTexture() const
nkAstraeus::PbsMaterial::getEnvironmentTextureIsCubeByDefault
bool getEnvironmentTextureIsCubeByDefault() const
nkAstraeus::PbsMaterial::load
virtual bool load() override
nkAstraeus::PbsMaterial::setPbsModel
void setPbsModel(PBS_MODEL value)
nkAstraeus::PbsMaterial::getReconstructBinormals
bool getReconstructBinormals() const
nkAstraeus::PbsMaterial::setMixEmissiveColorAndTexture
void setMixEmissiveColorAndTexture(bool value)
nkAstraeus::PbsMaterial::setSpecularColor
void setSpecularColor(const nkMaths::Vector &value)
nkAstraeus::Material
Base class for all materials in the component.
Definition: Material.h:16
nkAstraeus::PbsMaterial::setSpecularTexture
void setSpecularTexture(nkGraphics::Texture *value, THREE_CHANNEL_PACK channels=THREE_CHANNEL_PACK::RGB)
nkAstraeus::PbsMaterial::unload
virtual void unload() override
nkAstraeus::PbsMaterial::setShadowMapTexture
void setShadowMapTexture(nkGraphics::Texture *value, nkGraphics::Camera *shadowCamera, const ShadowMapParameters &parameters=ShadowMapParameters())
nkAstraeus::THREE_CHANNEL_PACK::RGB
@ RGB
Red, green, blue channels.
nkAstraeus::PbsMaterial::getEnvironmentColor
nkMaths::Vector getEnvironmentColor() const
nkAstraeus::PbsMaterial::setNormalMapTexture
void setNormalMapTexture(nkGraphics::Texture *value, THREE_CHANNEL_PACK channels=THREE_CHANNEL_PACK::RGB)
nkAstraeus::PbsMaterial::setTangentAttributeName
void setTangentAttributeName(nkMemory::StringView value)
nkAstraeus::PbsMaterial::setReconstructBinormals
void setReconstructBinormals(bool value)
nkMaths::Vector
A 4-component vector class, with floats.
Definition: Vector.h:12
nkAstraeus::PbsMaterial::setMixRoughnessGlossinessFactorAndTexture
void setMixRoughnessGlossinessFactorAndTexture(bool value)
nkAstraeus::PbsMaterial::getAlphaTextureChannels
ONE_CHANNEL_PACK getAlphaTextureChannels() const
nkAstraeus::PbsMaterial::setMetalnessTexture
void setMetalnessTexture(nkGraphics::Texture *value, ONE_CHANNEL_PACK channel=ONE_CHANNEL_PACK::A)
nkAstraeus::PbsMaterial::setAlphaTexture
void setAlphaTexture(nkGraphics::Texture *value, ONE_CHANNEL_PACK channel=ONE_CHANNEL_PACK::A)
nkAstraeus::PbsMaterial::setPositionAttributeName
void setPositionAttributeName(nkMemory::StringView value)
nkAstraeus::PbsMaterial::setNormalAttributeName
void setNormalAttributeName(nkMemory::StringView value)